#lang r5rs
(define a (cons 1 (cons 3 (cons (cons 5 (cons 7 '())) (cons 9 '())))))
(define b (cons (cons 7 '()) '()))
(define c (cons 1 (cons (cons 2 (cons (cons 3 (cons (cons 4 (cons (cons 5 (cons (cons 6 (cons 7 '())) '())) '())) '())) '())) '())))
(define (abc-solution)
  (define x car)
  (define y cdr)
  (display (x (y (x (y (y a)))))) ;yyxyx a
  (newline)
  (display (x (x b))) ;xx b
  (newline) 
  (display (x(y(x(y(x(y(x(y(x(y(x(y c)))))))))))))
  (newline)) ; yxyxyxyxyxyx c

(abc-solution)

(define x (list 1 2 3))
(define y (list 4 5 6))
(display (append x y))
(newline)
(display (cons x y))
(newline)
(display (list x y))
(newline)